	*YouGov 2016b
*coding
*first open "Yougov_2016b_BJPS_raw.dta", then do the below commands
gen trumptherm=poltitcian_therm_trump/100 if poltitcian_therm_trump<998
gen votetrump=.
replace votetrump=0 if vote_choice==2
replace votetrump=1 if vote_choice==1
gen aofmanwb0to1=(ascent_white-ascent_black+100)/200
gen sterblazy=stereo_black_lazy
replace sterblazy=((sterblazy*(-1))+7)/6
gen sterwlazy=stereo_white_lazy
replace sterwlazy=((sterwlazy*(-1))+7)/6
gen sterbwlazy=(sterblazy-sterwlazy+1)/2
gen sterbunint=stereo_black_intelligent
replace sterbunint=((sterbunint*(-1))+7)/6
gen sterwunint=stereo_white_intelligent
replace sterwunint=((sterwunint*(-1))+7)/6
gen sterbwunint=(sterbunint-sterwunint+1)/2
egen sterbwindex=rowmean(sterbwlazy sterbwunint)
gen pidrep0to1=pid7 if pid7 < 8
replace pidrep0to1=(pidrep0to1-1)/6
gen ideo0to1=(ideology-1)/6
gen female=0
replace female=1 if gender==2
gen age=2016-birthyr
tab age
gen age0to1=(age-18)/70
gen inc0to1=faminc
recode inc0to1 31=. 97=.
replace inc0to1=(inc0to1-1)/13
gen educ0to1=(educ-1)/5
gen south=0
replace south=1 if inputstate==1|inputstate==45|inputstate==28|inputstate==12|inputstate==13|inputstate==22|inputstate==48|inputstate==51|inputstate==5|inputstate==37|inputstate==47
gen bornagain=0
replace bornagain=. if pew_bornagain==.
replace bornagain=1 if pew_bornagain==1
gen limgov=limited_gov
recode limgov (1=1)(2=0)(8=.)
gen auth1=authoritarianism_respect
recode auth1 (1=0)(2=1)(8=.)
gen auth2=authoritarianism_curious
recode auth2 (1=0)(2=1)(8=.)
gen auth3=authoritarianism_obey
recode auth3 (1=1)(2=0)(8=.)
gen auth4=authoritarianism_behave
recode auth4 (1=0)(2=1)(8=.)
alpha auth1 auth2 auth3 auth4, gen (authoritarianism)
label var authoritarianism "Authoritarianism"
gen elite1=1-((anti_elitism_rich-1)/4) if anti_elitism_rich<8
gen elite2=1-((anti_elitism_struggle-1)/4) if anti_elitism_struggle<8
gen elite3=1-((anti_elitism_stacked-1)/4) if anti_elitism_stacked<8
alpha elite1 elite2 elite3, gen (antielitism) 
gen mistrust1=1-((mistrust_expert_wisdom-1)/4) if mistrust_expert_wisdom<8 
gen mistrust2=1-((mistrust_expert_capable-1)/4) if mistrust_expert_capable<8
alpha mistrust1 mistrust2, gen (mistrust)
gen decreasehisp=(immigration_hispanics-1)/4 if immigration_hispanics<8
gen rr1=1-((race_statement_irish-1)/4) if race_statement_irish<8
gen rr2=1-((race_statement_tryharder-1)/4) if race_statement_tryharder<8
gen rr3=(race_statement_deserve-1)/4 if race_statement_deserve<8
gen rr4=(race_statement_slavery-1)/4 if race_statement_slavery<8
alpha rr1 rr2 rr3 rr4, gen (raceres)
gen cbsavage=((dehumanizing_blacks_savage*(-1))+5)/4 if  dehumanizing_blacks_savage<8
gen cbbarbaric=((dehumanizing_blacks_barbaric*(-1))+5)/4 if dehumanizing_blacks_barbaric<8
gen cbnorestraint=((dehumanizing_blacks_selfrestrain*(-1))+5)/4 if dehumanizing_blacks_selfrestrain<8
gen sympathyblacks=1-((black_sympathy-1)/3)
alpha cbbarbaric cbsavage cbnorestraint, gen(cb) item
gen crimeexp=.
recode crimeexp .=0 if black_crime==1
recode crimeexp .=1 if black_crime==2
gen ofr=(race_statement_date-1)/4 if race_statement_date<8
gen sterbnolearn=((stereo_black_learn*(-1))+7)/6 if stereo_black_learn<8
gen sterwnolearn=((stereo_white_learn*(-1))+7)/6 if stereo_white_learn<8
gen sterbwnolearn=(sterbnolearn-sterwnolearn+1)/2
gen whiteid=1-((white_identity-1)/4) if white_identity<8
gen whitepride=1-((white_pride-1)/4) 
gen whitecommon=1-((white_commonality-1)/4) if white_commonality<8
alpha whiteid whitepride whitecommon, gen (bigwhiteid)
gen guiltass=((guilt1*(-1))+5)/4 if guilt1<8
gen guiltpriv=((guilt2*(-1))+5)/4 if guilt2<8
gen guiltineq=((guilt3*(-1))+5)/4 if guilt3<8
alpha guiltass guiltpriv guiltineq, gen(guilt) item

*analyses
**** FIGURE 2A ****
hist aofmanwb0to1, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	yscale(titlegap(2) range(0 30)) ///
	ytitle("Percent of Respondents") ///
	xtitle("") ///
	bin(71) ///
	xscale(titlegap(4) range(0 1)) ///
	xlabel(.01 `" "Blacks" "More" "Evolved" "' .5 "Equal" .99 `" "Whites" "More" "Evolved" "') 

**** TABLE 2 COLUMN 4 ****
svyset[pweight = weight]
svy: regress trumptherm aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south

**** TABLE 3 ****
svyset[pweight = weight]
svy: logit votetrump aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
svy: logit votetrump aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism antielitism
svy: logit votetrump aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism antielitism mistrust
svy: logit votetrump aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism antielitism mistrust decreasehisp

**** FIGURE 3 ****
*please note this figure is based on Table 3, Model 4 (not Table 4, Model 4 as incorrectly stated in ms text)
svy: logit votetrump aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism antielitism mistrust decreasehisp
margins, at(aofmanwb0to1=(.5(.1)1))
marginsplot, ///
	title("") ///
	ytitle("Predicted probability(vote Trump)") ///
    xtitle("Ascent of Man Scale") ///
    yscale(titlegap(2)) ///
    ylabel(.4 ".4" .6 ".6" .8 ".8" 1 "1", angle(0)) ///
    ytick(.4(.2)1, grid) ///
    xscale(titlegap(1)) ///
    xlabel(.5 "Neutral" .95 `" "Most" "dehumanization" "') ///
    graphregion( color(white) ) ///
    plot1op(lcolor(black) lwidth(medium) mcolor(black) lpattern(solid)) ///
    ci1opts(color(gs12)) ///
    recast(line) recastci(rarea) ///
    legend(cols(1)) ///
    l(90)

**** WEB APPENDIX F ****
*add option "sig" for significance tests
	**TABLE F1A COLUMN 4**
pwcorr aofmanwb0to1 cb raceres sterbwindex sterbwunint sterbwlazy ofr sterbwnolearn

	**TABLE F1B COLUMN 4**
pwcorr cb aofmanwb0to1 raceres sterbwindex sterbwunint sterbwlazy ofr sterbwnolearn

	**TABLE F2**
pwcorr aofmanwb0to1 pidrep0to1 ideo0to1 educ0to1 inc0to1 age0to1 female south
pwcorr cb pidrep0to1 ideo0to1 educ0to1 inc0to1 age0to1 female south

**** WEB APPENDIX J ****

	**** TABLE J3 ****
svyset[pweight = weight]
svy: regress trumptherm aofmanwb0to1 
	
	**** TABLE J4 ****
svyset[pweight = weight]
svy: reg trumptherm aofmanwb0to1 raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 
svy: reg trumptherm aofmanwb0to1 crimeexp pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 
svy: reg trumptherm aofmanwb0to1 ofr pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 
svy: reg trumptherm aofmanwb0to1 sterbwnolearn pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 
	
	**** TABLE J5 ****
svyset[pweight = weight]
svy: reg trumptherm aofmanwb0to1 bigwhiteid pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 
svy: reg trumptherm aofmanwb0to1 guilt pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south 

**** WEB APPENDIX K ****
	**** TABLE K1 ****
svyset [pweight=weight]
svy: logit votetrump aofmanwb0to1 raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
svy: logit votetrump aofmanwb0to1 crimeexp pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
svy: logit votetrump aofmanwb0to1 ofr pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
svy: logit votetrump aofmanwb0to1 sterbwnolearn pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
	
	**** TABLE K2 ****
svyset [pweight=weight]
svy: logit votetrump aofmanwb0to1 bigwhiteid pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism
svy: logit votetrump aofmanwb0to1 guilt pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south bornagain limgov authoritarianism

**** WEB APPENDIX L ****
	**** TABLE L1 ****
svyset[pweight = weight]
svy: regress trumptherm aofmanwb0to1 sterbwindex pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south c.aofmanwb0to1##c.pidrep0to1

	**** FIGURE L1 ****	
*formatting not included - available from authors upon request
margins, dydx(aofmanwb0to1) at(pidrep0to1=(0(.1)1))
marginsplot
	
	*YouGov 2016a

*coding
*first open "Yougov_2016a_BJPS_raw.dta", then do the below commands
gen trumptherm100=UMI443
recode trumptherm100 998=.
gen trumptherm=trumptherm100/100
gen aofmanb=UMI430_blacks
gen aofmanw=UMI430_whites
gen aofmanwb=(aofmanw-aofmanb+100)/200
gen stlazyb=UMI433
replace stlazyb=(stlazyb-1)/6
gen stlazyw=UMI432
replace stlazyw=(stlazyw-1)/6
gen stlazywb=(-1)*((stlazyw-stlazyb+1)/2)+1
gen pidrep0to1=pid7
recode pidrep0to1 8=4
replace pidrep0to1=(pidrep-1)/6
gen ideo0to1=ideo5
recode ideo0to1 6=3
replace ideo0to1=(ideo0to1-1)/4
gen male=gender
recode male 2=0
gen female=male
recode female 1=0 0=1
gen age=2015-birthyr
gen age0to1=(age-18)/68
gen inc0to1=faminc
recode inc0to1 31=. 97=.
replace inc0to1=(inc0to1-1)/14
gen educ0to1=(educ-1)/5
gen south=0
replace south=1 if MICH_region==4
gen deserve=UMI426
recode deserve 8/9=.
recode deserve 5=1 4=.75 3=.5 2=.25 1=0
tab deserve
gen irish=UMI427
recode irish 8/9=.
recode irish 1=1 2=.75 3=.5 4=.25 5=0
tab irish
gen tryharder=UMI428
recode tryharder 8/9=.
recode tryharder 1=1 2=.75 3=.5 4=.25 5=0
tab tryharder
gen generations=UMI429
recode generations 8/9=.
recode generations 5=1 4=.75 3=.5 2=.25 1=0
tab generations
alpha deserve irish tryharder generations, gen(racialresentment)
gen raceres=racialresentment
gen cbbarbaric=UMI431_1
recode cbbarbaric -1=.
replace cbbarbaric=(cbbarbaric-1)/6
gen cbsavage=UMI431_2
recode cbsavage -1=.
replace cbsavage=(cbsavage-1)/6
gen cbnorestraint=UMI431_3
recode cbnorestraint -1=.
replace cbnorestraint=(cbnorestraint-1)/6
alpha cbbarbaric cbsavage cbnorestraint, gen(cb)
gen racesymp1=.
replace racesymp1=0 if UMI402==2
replace racesymp1=.25 if UMI403==4
replace racesymp1=.5 if UMI403==3
replace racesymp1=.75 if UMI403==2
replace racesymp1=1 if UMI403==1
gen racesymp2=.
replace racesymp2=0 if UMI408==2
replace racesymp2=.25 if UMI409==4
replace racesymp2=.5 if UMI409==3
replace racesymp2=.75 if UMI409==2
replace racesymp2=1 if UMI409==1
gen racesymp3=.
replace racesymp3=0 if UMI412==2
replace racesymp3=.25 if UMI413==4
replace racesymp3=.5 if UMI413==3
replace racesymp3=.75 if UMI413==2
replace racesymp3=1 if UMI413==1
gen racesymp4=.
replace racesymp4=0 if UMI417==2
replace racesymp4=.25 if UMI418==4
replace racesymp4=.5 if UMI418==3
replace racesymp4=.75 if UMI418==2
replace racesymp4=1 if UMI418==1
gen racesymp4rev=((racesymp4*(-1)))+1
alpha racesymp1 racesymp2 racesymp3 racesymp4, gen(racialsympathy) item
gen sympb=racialsympathy

*analyses 

**** TABLE 2 COLUMN 3 ****
svyset [pweight=weight]
svy: regress trumptherm aofmanwb stlazywb pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south

****WEB APPENDIX F****
	**TABLE F1A COLUMN 3**
pwcorr aofmanwb cb raceres stlazywb 

	**TABLE F1B COLUMN 3**
pwcorr cb aofmanwb raceres stlazywb  
	
****WEB APPENDIX J****
	****TABLE J2
svyset [pweight=weight]
svy: reg trumptherm aofmanwb raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
svy: reg trumptherm aofmanwb sympb pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
	
	*2016 GfK
*coding
*first open "GfK_raw.dta", then do the below commands
gen thermtrump=Q6_DonaldTrump
recode thermtrump -1=.
gen thermtrump0to1=thermtrump/100
gen thermobama=Q6_BarackObama
recode thermobama -1=.
gen thermobama0to1=thermobama/100
gen aofmanb=Q2_Blacks
recode aofmanb -1=.
gen aofmanw=Q2_Whites
recode aofmanw -1=.
gen aofmanwb=(aofmanw-aofmanb+100)/200
gen cbbarbaric=Q4_2
recode cbbarbaric -1=.
replace cbbarbaric=(cbbarbaric-1)/6
gen cbsavage=Q4_3
recode cbsavage -1=.
replace cbsavage=(cbsavage-1)/6
gen cbnorestraint=Q4_5
recode cbnorestraint -1=.
replace cbnorestraint=(cbnorestraint-1)/6
alpha cbbarbaric cbsavage cbnorestraint, gen(cb) item
gen sterintelligent=Q4_4
recode sterintelligent -1=.
replace sterintelligent=1-(sterintelligent-1)/6
gen pidrep0to1=party7
replace pidrep0to1=((pidrep0to1*(-1)+7))/6
gen ideo0to1=ideo
recode ideo0to1 8=.
replace ideo0to1=(ideo0to1-1)/6
gen female=0
replace female=1 if PPGENDER==2
gen age0to1=(PPAGE-18)/71
gen inc0to1=(PPINCIMP-1)/18
gen educ0to1=(PPEDUCAT-1)/3
label variable educ0to1 "Education"
gen south=0
replace south=1 if PPREG4==3
replace south=. if PPREG4==.
gen raceresirish=Q9_1
recode raceresirish -1=.
replace raceresirish=((raceresirish*(-1))+5)/4
gen racerestry=Q9_4
recode racerestry -1=.
replace racerestry=((racerestry*(-1))+5)/4
gen raceresgenrev=Q9_2
recode raceresgenrev -1=.
replace raceresgenrev=(raceresgenrev-1)/4
gen raceresdesrev=Q9_3
recode raceresdesrev -1=.
replace raceresdesrev=(raceresdesrev-1)/4
alpha raceresirish racerestry raceresgenrev raceresdesrev, gen(raceres) item
label variable raceres "Racial Resentment"
save "/Users/spencerpiston/Dropbox/Dehumanization Jardina/Dehumanization/Trump and dehumanization/BJPS fall 2019/BJPS Final/BJPS Data/SP replication/GfK_coded.dta", replace

*analyses 

**** FIGURE 2b ****
hist cb, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	ylabel(, nogrid) ///
	yscale(titlegap(2)) ///
	ytitle("Percent of respondents") ///
	bin(19) ///
	xscale(titlegap(4) range(0 1)) ///
	xlabel(.04 `" "Not at" "all well" "' .96 `" "Extremely" "well" "') ///
	xtitle("")

**** TABLE 2 COLUMNS 1 AND 2 ****
svyset [pweight=weight]
svy: regress thermtrump0to1 aofmanwb sterintelligent pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
svy: regress thermtrump0to1 cb sterintelligent pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
	
**** TABLE 4 COLUMNS 3 AND 4 ****
svyset [pweight=weight]
svy: regress thermobama0to1 aofmanwb sterintelligent pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
svy: regress thermobama0to1 cb sterintelligent pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south

**** WEB APPENDIX B ****
	**** FIGURE B1 ****
hist aofmanw, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	yscale(titlegap(2)) ///
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	ytitle("Percent of Respondents") ///
	xtitle("") ///
	xscale(titlegap(4) range(0 1)) ///
	bin(71) ///
	xlabel(1 `" "Least" "Evolved" "' 99 `" "Most" "Evolved" "') 
	**** FIGURE B2 ****
hist aofmanb, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	yscale(titlegap(2)) ///
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	ytitle("Percent of Respondents") ///
	xtitle("") ///
	xscale(titlegap(4) range(0 1)) ///
	bin(71) ///
	xlabel(1 `" "Least" "Evolved" "' 99 `" "Most" "Evolved" "') 

****WEB APPENDIX F****
	**TABLE F1A COLUMN 2**
pwcorr aofmanwb cb raceres 
	
	**TABLE F1B COLUMN 2**
pwcorr cb aofmanwb raceres 

**** WEB APPENDIX G ****
	**** Figure G1. Barbaric ****
hist cbbarbaric, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	yscale(titlegap(2) range(0 60)) ///
	bin(7) ///
	xtitle("") ///
	xlabel(.07 `" "Not At" "All" "Well" "' .93 `" "Extremely" "Well" "')
	**** Figure G2. Savage ****
hist cbsavage, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	yscale(titlegap(2) range(0 60)) ///
	bin(7) ///
	xtitle("") ///
	xlabel(.07 `" "Not At" "All" "Well" "' .93 `" "Extremely" "Well" "')
	**** Figure G3. Lacking self-restraint, like animals ****
hist cbnorestraint, percent ///
	graphregion( color(white) ) ///
	fcolor(gray) lcolor(black) /// 
	ylabel(0 "0" 10 "10" 20 "20" 30 "30" 40 "40" 50 "50" 60 "60", nogrid) ///
	yscale(titlegap(2) range(0 60)) ///
	bin(7) ///
	xtitle("") ///
	xlabel(.07 `" "Not At" "All" "Well" "' .93 `" "Extremely" "Well" "')

**** WEB APPENDIX H ****

	**** TABLE H1, COLUMNS 3 AND 4 ****
svyset [pweight=weight]
svy: reg thermobama0to1 aofmanwb raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
svy: reg thermobama0to1 cb raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south

	
**** WEB APPENDIX J ****
	**** TABLE J1 ****
svyset [pweight=weight]
svy: reg thermtrump0to1 aofmanwb raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
svy: reg thermtrump0to1 cb raceres pidrep0to1 ideo0to1 female age0to1 inc0to1 educ0to1 south
	
	*2016 Qualtrics
*coding
*first open "Qualtrics_2016_BJPS_raw.dta", then do the below commands
gen obamatherm0to1=obamatherm/100
gen trumptherm0to1=trumptherm/100
gen rubiotherm0to1=rubiotherm/100
gen cruztherm0to1=cruztherm/100
gen bushtherm0to1=bushtherm/100
gen aofmanpicblacks=aofmanpic_1/100
gen aofmannopicblacks=aofmannopi_1/100
gen aofmanvinceblacks=aofmanvinc_1/100
egen aofmanblacks=rowmean(aofmanpicblacks aofmannopicblacks aofmanvinceblacks)
gen aofmanpicwhites=aofmanpic_4/100
gen aofmannopicwhites=aofmannopi_4/100
gen aofmanvincewhites=aofmanvinc_4/100
egen aofmanwhites=rowmean(aofmanpicwhites aofmannopicwhites aofmanvincewhites)
gen aofmanpicwb=(aofmanpicwhites-aofmanpicblacks+1)/2
gen aofmannopicwb=(aofmannopicwhites-aofmannopicblacks+1)/2
gen aofmanvincewb=(aofmanvincewhites-aofmanvinceblacks+1)/2
gen aofmanwb=(aofmanwhites-aofmanblacks+1)/2
gen aofmanpicwbbig=(aofmanpicwb*200)-100
gen aofmannopicwbbig=(aofmannopicwb*200)-100
gen aofmanvincewbbig=(aofmanvincewb*200)-100
gen cbbarbaric=charblacks_1
gen cbsavage=charblacks_4
gen cbnorestraint=charblacks_8
gen cbbarbaricrev=(cbbarbaric*(-1))+6
gen cbsavagerev=(cbsavage*(-1))+6
gen cbnorestraintrev=(cbnorestraint*(-1))+6
alpha cbbarbaric cbsavage cbnorestraint, gen(cnegbsmall)
gen cnegbsmall0to1=((cnegbsmall*(-1))+5)/4
gen whiteshardworking=1-((sterlazy_1-1)/6)
gen blackshardworking=1-((sterlazy_2-1)/6)
gen whitesintell=1-((sterunint_1-1)/6)
gen blacksintell=1-((sterunint_2-1)/6)
gen wbintell=(whitesintell-blacksintell)/2
gen wbhardworking=(whiteshardworking-blackshardworking)/2
gen whitestereo=(whiteshardworking+whitesintell)/2 
gen blackstereo=(blackshardworking+blacksintell)/2
gen bwstereoindex=((whitestereo-blackstereo)+1)/2
gen whitepeaceful=1-((sterviolen_1-1)/6)
gen blackpeaceful=1-((sterviolen_2-1)/6)
gen whitestereobig=(whiteshardworking+whitesintell+whitepeaceful)/3 
gen blackstereobig=(blackshardworking+blacksintell+blackpeaceful)/3
gen bwstereoindexbig=((whitestereo-blackstereo)+1)/2
gen blackmarriage=ofrmarriag
recode blackmarriage (2=0)(3=.5)(4=1)
gen partyid2=.
replace partyid2=6 if party1==2
replace partyid2=0 if party1==2
replace partyid=3 if party1==3
replace partyid2=0 if strongdem==1
replace partyid2=1 if strongdem==2
replace partyid2=6 if strongrep==1
replace partyid2=5 if strongrep==2
replace partyid2=2 if closeparty==1
replace partyid2=4 if closeparty==2
replace partyid=3 if closeparty==3
gen partyid=(partyid2)/6
gen republican=partyid
gen polideology=(ideology-1)/6
gen conservative=polideology 
gen female=0
replace female=1 if male==0 
gen birthyear2=birthyear+1919
gen age2=(2016-birthyear2)
gen income2=(income-1)/18
gen educ=(education-1)/13
gen south=.
replace south=0 if state_1~=.
replace south=1 if state_1==1|state_1==4|state_1==10|state_1==11|state_1==19|state_1==25|state_1==34|state_1==41|state_1==43|state_1==44|state_1==47
gen rr1=1-((rrirish-1)/3)
gen rr2=(rrdes-1)/3
gen rr3=1-((rrtry-1)/3)
gen rr4=(rrdisc-1)/3
alpha rr1 rr2 rr3 rr4, gen (raceres)
gen neighseg=ofrseg
recode neighseg (1=1)(2=0)
gen discrimination=1-((racineqatt_1-1)/4)
gen inborn=1-((racineqatt_2-1)/4)

*analyses 
**** TABLE 1 ****
reg trumptherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1
reg rubiotherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg rubiotherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1
reg cruztherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg cruztherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1
reg bushtherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg bushtherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1

**** TABLE 4 MODELS 1 and 2 ****
reg obamatherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1

**** WEB APPENDIX C ****
	**** FIGURE C1 ****
mean aofmanpicwbbig if white==1
mean aofmannopicwbbig if white==1
mean aofmanvincewbbig if white==1
*making these into a single figure requires more code, which 
*is available from the authors upon request

**** WEB APPENDIX F ****
	**** TABLE F1A COLUMN 1 ****
pwcorr aofmanwb cnegbsmall0to1 raceres bwstereoindex wbintell wbhardworking blackmarriage neighseg if white==1

	**** TABLE F1B COLUMN 1 ****
pwcorr cnegbsmall0to1 aofmanwb raceres bwstereoindex wbintell wbhardworking blackmarriage neighseg if white==1, sig obs star(0.05)

**** WEB APPENDIX H ****
	**** TABLE H1, COLUMNS 1 AND 2 ****
reg obamatherm0to1 aofmanwb raceres republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 raceres republican conservative female age2 income2 educ south if white==1

	**** TABLE H2 ****
reg obamatherm0to1 aofmanwb bwstereoindexbig republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 bwstereoindexbig republican conservative female age2 income2 educ south if white==1

	**** TABLE H3 ****
reg obamatherm0to1 aofmanwb blackmarriage republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 blackmarriage republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 aofmanwb neighseg republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 neighseg republican conservative female age2 income2 educ south if white==1

	**** TABLE H4 ****
reg obamatherm0to1 aofmanwb inborn republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 inborn republican conservative female age2 income2 educ south if white==1

	**** TABLE H5 ****
reg obamatherm0to1 aofmanwb discrimination republican conservative female age2 income2 educ south if white==1
reg obamatherm0to1 cnegbsmall0to1 discrimination republican conservative female age2 income2 educ south if white==1
	
**** WEB APPENDIX I ****
	**** TABLE I1 ****
reg trumptherm0to1 aofmanwb raceres republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 raceres republican conservative female age2 income2 educ south if white==1

	**** TABLE I2 ****
reg trumptherm0to1 aofmanwb bwstereoindex republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 bwstereoindex republican conservative female age2 income2 educ south if white==1

	**** TABLE I3 COLUMNS 1 AND 2 ****
reg trumptherm0to1 aofmanwb blackmarriage republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 blackmarriage republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 aofmanwb neighseg republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 neighseg republican conservative female age2 income2 educ south if white==1

	**** TABLE I4 ****
reg trumptherm0to1 aofmanwb inborn republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 inborn republican conservative female age2 income2 educ south if white==1

	**** TABLE I5 ****
reg trumptherm0to1 aofmanwb discrimination republican conservative female age2 income2 educ south if white==1
reg trumptherm0to1 cnegbsmall0to1 discrimination republican conservative female age2 income2 educ south if white==1
